#include "../debug.hpp"

#include "run_time_info_bar.hpp"

namespace lge2d
{

RunTimeInfoBar::RunTimeInfoBar():m_window(0), m_font(0)
{
}

RunTimeInfoBar::RunTimeInfoBar(sf::RenderWindow* window, sf::Font * font) :
		m_window(window), m_font(font), m_bar_pos(0, 0), m_int_fps_renderer(
				font)
{
}

void RunTimeInfoBar::Initialize()
{
	assert(NULL != m_window);
	assert(NULL != m_font);

	m_int_fps_renderer.SetFont(m_font);
	m_int_fps_renderer.Initialize();
}

bool RunTimeInfoBar::OnEvent(const sf::Event& event)
{
	return false;
}

void RunTimeInfoBar::Update(float /*dt*/)
{
	m_fps_counter.AddOneFrame();
}

void RunTimeInfoBar::Render() const
{
	int fps = m_fps_counter.GetFPS();
	m_int_fps_renderer.Render(m_window, fps);
}

RunTimeInfoBar::~RunTimeInfoBar()
{
}

} /* namespace lge2d */
